/*
 * Licensed to Nanjing RedOrange Co. ltd (RedOrange) under one or more
 * contributor license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * RedOrange licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package redora.rdo.api;

/**
 * FetchScope groups the attributes that are fetched in a query.
 * Usually you want to retrieve a minimum amount of data from the database because this
 * information not only will be retrieved from the database, it must also be transported on some network.
 * Using the correct FetchScope minimalizes the transported data size and therefore it will improve performance.
 * <br>
 * In the model you can set per attribute it's FetchScope with the lazy and list attributes. Each attribute type
 * has different default settings for list/lazy and you cannot set list/lazy for every attribute.
 * <br>
 * If list="true" the attribute will be available for the List FetchScope;<br>
 * If lazy="true" the attribute will not be included in the Table FetchScope;<br>
 * The Form FetchScope will have all attributes, excluding the lazy set attributes.
 * <br>
 * A List scope fetch can reasonably only be used for read only purposes. The Table scope fetch can be
 * upgraded to a fully writable Form scope by fetching the missing attributes with a Lazy scoped fetch.
 * 
 * @author Redora
 */
public enum FetchScope {
	/** Usually all the records. The information is displayed in a single record layout. */
	Form,
	/** When records are shown in a table view, usually 5 to 10 attributes per record line.*/ 
	Table,
	/** When displayed in a drop down list. You want to show one or two fields.*/
	List,
	/** This scope will retrieve the missing attributes (those that are lazy and not set type.*/
	Lazy
}
